home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / infoserv / gopher / Unix / gopher-gateways / techinfo / techinpher / v1.0 / node.h.Z / node.h
Encoding:
C/C++ Source or Header  |  1993-01-26  |  2.7 KB  |  73 lines

  1. /*
  2.  * node.h:  Common header file for server & client.
  3.  */
  4.  
  5. #ifndef _NODE_H
  6. #define _NODE_H
  7.  
  8. /* Values used in a node's flags field */
  9. /* These flags are INTERNAL and are not saved to disk */
  10. #define    N_ONSTACK    0x1    /* Tag Used for infinite loop protection */
  11. #define    N_CALLEDON    0x2    /* Already been passed to a traverse func */
  12. #define    N_RESOLVED    0x4    /* Have link node-ids been resolved to ptrs? */
  13. #define N_SYSGEN_FN     0x20   /* File name should be maintained by server */
  14. #define N_HIT           0x1000 /* Internal flag for WAIS search */
  15.  
  16. /* These are "real" flags that are saved to disk */
  17. #define N_FAKE        0x8    /* Created by web_node to keep things happy */
  18. #define N_TEXT          0x10   /* This is a document node */
  19. #define N_IMAGE         0x40   /* The node is an image (GIF) at this time */
  20. #define N_DONT_STAT     0x80   /* Stat the file to update modify date? */
  21. #define N_SERVER_NODE   0x100  /* a link to another server */
  22. #define N_MENU          0x200  /* this represents a menu item - reserved */
  23. #define N_BINARY        0x400  /* this represents a binary item - reserved */
  24. #define N_DONT_INDEX    0x800  /* Don't index this node for full text search */
  25.  
  26. #define N_TELNETSESSION 0x2000 /* client starts telnet Added Jan 1993 --lam */
  27.  
  28. /* Don't save the following flags when we save the web */
  29. #define N_NOSAVE        (N_ONSTACK | N_CALLEDON | N_RESOLVED | N_SYSGEN_FN |\
  30.                         N_HIT)
  31.  
  32.  
  33. #define    setflag(n, flag)    ((n)->nd_flags |= (flag))
  34. #define    clrflag(n, flag)    ((n)->nd_flags &= ~(flag))
  35. #define    flagset(n, flag)    ((n)->nd_flags & (flag)) /* is the flag set */
  36.  
  37.  
  38. #define    text_node(n)        (*n_file(n) && *n_file(n) != ' ')
  39.  
  40. /* Output codes necessitated by client bugs which crashed when a node's flags 
  41.    field contained values it didn't like.  Thus the default output format 
  42.    zeros out the flags field, while the new and better format sends the flags 
  43.    across.  The format is changed with the 'O' transaction, which supposedly 
  44.    only new clients will do, to request the new format & get the flags.   
  45.    Added 8/12/92 ark */
  46. #define NO_FLAGS_FORMAT          1        /* Zeros out flags field */
  47. #define SEND_FLAGS_FORMAT        2        /* Sends flags unchanged */
  48. #define TELNET_FORMAT            3        /* "Pretty printing" to make 
  49.                          telnet readable */
  50. #define NUM_FORMATS              3
  51. #define DEFAULT_OUTPUT_FORMAT    NO_FLAGS_FORMAT
  52.  
  53.  
  54. /*
  55.  * Flags for web_traverse
  56.  */
  57. #define    TRAV_UP        0x1
  58. #define TRAV_DOWN    0x2
  59. #define    TRAV_OUT    (TRAV_UP|TRAV_DOWN)
  60. #define    TRAV_NOREPEAT    0x4
  61.  
  62. #define    NLINE_MAXLEN    4096
  63. #define    NL_SAVE        1
  64. #define    NL_RESTORE    2
  65. #define NL_RESTORE_OR   3
  66. #define NL_RESTORE_AND  4  
  67.  
  68. /* Increased NLIST_MAX_LEN from 4096 to 8192 8/3/92 ark */
  69. #define    NLIST_MAX_LEN   8192    /* Max # of nodes in current list */
  70.  
  71.  
  72. #endif ndef _NODE_H
  73.